package com.gdteam.kernel.httpserver.impl;

import org.apache.tapestry5.ioc.annotations.EagerLoad;
import org.restlet.Application;

import com.gdteam.kernel.httpserver.HttpApplication;
import com.gdteam.kernel.main.ServiceManager;

@EagerLoad
public abstract class RestletApplication extends Application implements HttpApplication {

    public ServiceManager getServiceManager() {
        if (this.getContext().getAttributes().containsKey(SERVICE_MANAGER_KEY)) {
            return (ServiceManager) this.getContext().getAttributes().get(SERVICE_MANAGER_KEY);
        }
        
        return null;
    }
}
